package com.example.sxmall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.sxmall.dao.mapper.UsersMapper;
import com.example.sxmall.dao.pojo.Users;
import com.example.sxmall.service.UsersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhang
 * @since 2022-03-25
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {

    @Override
    public Users getByUsersName(String uaccount) {
        return getOne(new QueryWrapper<Users>().eq("uaccount", uaccount));
    }

    @Override
    public Integer getUserIdByAct(String uaccount) {
        Users users = getByUsersName(uaccount);
        return users.getUid();
    }

}

